# zip 将两个列表打包

ids = ["001", "002", "003", "004"]

names = ["张三", "李四", "王五", "赵六"]

print(list(zip(ids, names)))

for id, name in zip(ids, names):
    print(id, name)

# 使用zup构建字典
info = {}  # 创建一个空的字典

for id, name in zip(ids, names):
    # 往字典中插入元素
    info[id] = name

print(info)

# 循环字典
# 只循环字典的下标
for i in info:
    print(i)

# 循环key和value
for id, name in info.items():
    print(id,name)
